package com.heima.bos.utils;

import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.ServletActionContext;

public class BOSUtils {
	//验证码
	public static boolean checkCode(String checkcode){
		String code = (String) ServletActionContext.getRequest().getSession().getAttribute("key");
		
		if(!StringUtils.isBlank(checkcode) && checkcode.equals(code)){
			return true;
		}
		return false;
	}
	//获取session
	public static HttpSession getSession(){
		return ServletActionContext.getRequest().getSession();
	}
	
}
